package cn.hyh.service;

import org.springframework.stereotype.Service;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

/**
 * @auther :hyh
 * @desc :
 * @date :2020/1/7
 */
@Service
public class ContextService implements ServletContextAware {
	private  ServletContext  servletContext;
	@Override
	public void setServletContext(ServletContext servletContext) {
		System.out.println(servletContext);
		this.servletContext = servletContext;
	}


	public  String getServletStr() {
		return servletContext.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(servletContext));
	}
}
